package me.winds.foundation;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import me.winds.widget.usage.TitleView;
import me.winds.wrapper.base.presenter.BaseMvpPresenter;
import me.winds.wrapper.base.view.WrapperStatusActivity;

/**
 * Author:  winds
 * Email:   heardown@163.com
 * Date:    2019/5/26.
 * Desc:
 */
public class StatusActivity extends WrapperStatusActivity<BaseMvpPresenter> {

    @Override
    protected void initView(Bundle savedInstanceState, TitleView titleView, Intent intent) {
        super.initView(savedInstanceState, titleView, intent);
        titleView.setTitle("Status");
    }

    @Override
    protected void loadData(Bundle savedInstanceState, Intent intent) {
        getRootView().postDelayed(new Runnable() {
            @Override
            public void run() {
                getStatusDelegate().removeStatus();
            }
        }, 3000);
    }

    @Override
    protected int getViewLayout() {
        return R.layout.activity_swipe;
    }

    public void click(View view) {
        getStatusDelegate().processNetErrorStatusDefault();
        getRootView().postDelayed(new Runnable() {
            @Override
            public void run() {
                getStatusDelegate().removeStatus();
            }
        }, 3000);
    }
}
